import { createRouter, createWebHashHistory } from 'vue-router'
const routes = [
  {
    path: '/',
    component: () => import('../views/Layout/index.vue'),
    children: [
      {
        path: '/',
        component: () => import('../views/Home/index.vue')
      },
      {
        path: '/category/:id',
        component: () => import('../views/Category/index.vue')
      },
      {
        path: '/category/sub/:id',
        component: () => import('../views/Category/Sub/index.vue')
      },
      {
        path: '/category/sub/good/:id',
        component: () => import('../views/Goods/index.vue')
      }
    ]
  },
  {
    path: '/playground',
    component: () => import('../playground/index.vue')
  }

]
// 实例化路由对象
const router = createRouter({
  // 产出一个hasroty模式的配置
  history: createWebHashHistory(),
  routes
})

export default router
